package com.project.service.impl;

import com.project.bean.ProductBean;
import com.project.mapper.IProductMapper;
import com.project.service.IProductService;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class ProductServiceImpl implements IProductService {
    private IProductMapper mapper;
    @Override
    public void add(ProductBean product) {
        mapper.add(product);
//        int i = 9/0;
        mapper.add(new ProductBean("111", LocalDate.parse("2020-02-03"),80));
    }

    @Override
    public void del(int id) {
        mapper.del(id);
    }

    @Override
    public void update(int id, int price) {
        mapper.update(id,price);
    }

    @Override
    public List<ProductBean> findAll() {
        return mapper.findAll();
    }
}
